import http from "@/api/config/http";
import { IQuery, ITableResponse } from "@/interface/IAxios";
import { LibrarySize } from "./types";

export function librarySizeList(query: IQuery): Promise<ITableResponse<LibrarySize>> {
  return http.request({
    url: `/library/size/list`,
    method: "get",
    params: query
  });
}

export function deleteLibrarySize(ids: string[]) {
  return http.request({
    url: `/library/size/${ids.join(",")}`,
    method: "delete"
  });
}

export function createLibrarySize(data: LibrarySize) {
  return http.request({
    url: `/library/size`,
    method: "post",
    data
  });
}

export function updateLibrarySize(data: LibrarySize) {
  return http.request({
    url: `/library/size`,
    method: "put",
    data
  });
}

export const getLibrarySize = (id: string) => {
  return http.request({
    url: `/library/size/${id}`,
    method: "get"
  });
};
